package com.lagou.service.impl;

import com.lagou.mapper.ArticleMapper;
import com.lagou.pojo.Article;
import com.lagou.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * @author 123
 * @date 2020/4/15 15:03
 * @description
 */
@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public Page<Article> findAll(Integer pageNum,Integer pageSize) {
        Pageable pageable = PageRequest.of(pageNum, pageSize);
        return articleMapper.findAll(pageable);
    }
}
